home *** CD-ROM | disk | FTP | other *** search
- ALLOCA(3C) Last changed: 10-20-98
-
-
- NNAAMMEE
- aallllooccaa - Allocates dynamic space
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<aallllooccaa..hh>>
-
- vvooiidd **aallllooccaa ((uunnssiiggnneedd _s_i_z_e));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- aallllooccaa returns a pointer to _s_i_z_e bytes of uninitialized local stack
- space. Because the space is allocated using a built-in compiler
- function, the allocation is quite fast. If zero is passed as _s_i_z_e,
- aallllooccaa returns a valid pointer (unlike some versions of mmaalllloocc, which
- consider a zero size to be an error).
-
- The ##iinncclluuddee <<aallllooccaa..hh>> is required.
-
- Space allocated when a function ffoooo calls aallllooccaa is freed
- automatically when ffoooo returns.
-
- It is an error to call ffrreeee with a pointer returned by aallllooccaa.
-
- Not all environments have aallllooccaa in their libraries, so code using it
- is not necessarily portable. Reasonably portable public domain
- versions of this function are available from various sources on the
- Internet and the World Wide Web.
-
- FFIILLEESS
- //uussrr//iinncclluuddee//aallllooccaa..hh
-
- DDIIAAGGNNOOSSTTIICCSS
- In this implementation, aallllooccaa cannot fail (although if _s_i_z_e makes the
- process too large IRIX may kill the process). Because aallllooccaa always
- returns a valid pointer, no diagnostics are possible. Portability may
- be enhanced if the function calling aallllooccaa tests for a return value of
- 0 and handles 0 as an error.
-
- CCAAVVEEAATTSS
- Do not call aallllooccaa as an argument to another function, as in
- ffoooo((aallllooccaa((2200))));;. Use the following example instead:
-
- cp = alloca(20); foo(cp);
-
- SSEEEE AALLSSOO
- mmaalllloocc(3), ccaalllloocc(3), ffrreeee(3)
-
- This man page is available only online.
-
-